<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 发送手机短信记录表
 */
class CreateRecordSendSmsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('record_send_sms', function (Blueprint $table) {
            $table->increments('id');
            $table->string('phone',11)->default('')->comment('手机号码');
            $table->string('content',250)->default('')->comment('发送的短信内容');
            $table->string('params',250)->default('')->comment('短信参数');
            $table->string('ip',20)->default('')->comment('发送来源的IP地址');
            $table->string('tpl_id',20)->default('')->comment('模版ID');
            $table->string('errorCode',20)->default('')->comment('返回错误码');
            $table->string('errorReason',100)->default('')->comment('返回说明');
            $table->tinyInteger('isCheck')->default(0)->comment('是否已验证 0=否 1=是');
            $table->timestamp('checkTime')->nullable()->comment('验证时间');
            $table->tinyInteger('status')->default(0)->comment('发送状态 0=失败 1=成功');
            $table->string('createDay',10)->default('')->comment('发送时间,精确到天');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('record_send_sms');
    }
}
